using Domain.Entities;
using FluentNHibernate.Mapping;

namespace Database.Mappings
{
    public class UserMapping:ClassMap<User>
    {
        public UserMapping()
        {
            Id(x => x.Id);
            Map(x => x.UserName);
            Map(x => x.Password);
            Map(x => x.ApplicationName);
            Map(x => x.Comment);
            Map(x => x.CreationDate).Generated.Insert().Default("getdate()");
            Map(x => x.EMail);
            Map(x => x.FailedPasswordAnswerAttemptCount);
            Map(x => x.FailedPasswordAnswerAttemptWindowStart);
            Map(x => x.FailedPasswordAttemptCount);
            Map(x => x.FailedPasswordAttemptWindowStart);
            Map(x => x.IsApproved);
            Map(x => x.IsLockedOut);
            Map(x => x.IsOnline);
            Map(x => x.LastActivityDate);
            Map(x => x.LastLockedOutDate);
            Map(x => x.LastLoginDate);
            Map(x => x.LastPasswordChangedDate);
            Map(x => x.PasswordAnswer);
            Map(x => x.PrevLoginDate);
            Map(x => x.Role);
            HasMany(x => x.Quizes);
        }
    }
}